package com.chixing.ih.module.system.mapper.provider;

import com.chixing.ih.module.system.pojo.Admin;
import com.chixing.ih.module.system.pojo.User;
import org.apache.ibatis.jdbc.SQL;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘岩
 * Date: 2020-09-26
 * Time: 13:15
 *
 * @version 1.0
 */
public class AdminMapperProvider {

    public String insertOne() {
        return new SQL() {{
            INSERT_INTO("tbl_admin");
            VALUES("admin_account", "#{adminAccount}");
            VALUES("nick_name", "#{nickName}");
            VALUES("admin_password", "#{adminPassword}");
            VALUES("role_id", "#{roleId}");
        }}.toString();

    }



    public String getOneByAccount() {
        return new SQL() {{
            SELECT("*");
            FROM("tbl_admin");
            WHERE("admin_account = #{adminAccount}");
        }}.toString();
    }


    public String getOneByNickName() {
        return new SQL() {{
            SELECT("*");
            FROM("tbl_admin");
            WHERE("nick_name = #{nickName}");
        }}.toString();
    }

    public String getOne(Admin admin) {
        return new SQL() {{
            SELECT("*");
            FROM("tbl_admin");
            WHERE("admin_account = #{adminAccount} AND admin_password=#{adminPassword}");
        }}.toString();
    }


    public String deleteOneById() {
        return null;
    }


    public String getOneById() {
        return null;
    }


    public String listAll() {
        return null;
    }


    public String updateOne(User user) {
        return null;
    }


    public String deleteAll() {
        return null;
    }


}
